package com.primaryedu.ui.app.growstep;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.jauker.widget.BadgeView;
import com.primaryedu.R;
import com.primaryedu.data.GlobalData;
import com.primaryedu.ui.BaseActivity;

/**
 * 成长脚印
 *
 * @author jun.wang
 * @description
 * @data 2018年1月9日
 */
public class GrowStepActivity extends BaseActivity implements OnClickListener {
    private ListView listView;
    GrowStepAdapter adapter;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_grow_step);

        init();
    }

    private void init() {
        ((TextView) findViewById(R.id.title)).setText("成长脚印");
        findViewById(R.id.back).setOnClickListener(this);
        listView = (ListView) this.findViewById(R.id.listView);
        adapter = new GrowStepAdapter(this);
        listView.setAdapter(adapter);
        //我要记录
        findViewById(R.id.next).setOnClickListener(this);
        //班级动态
        findViewById(R.id.ll_mine_dynamic).setOnClickListener(this);
        //我的动态
        findViewById(R.id.ll_class_dynamic).setOnClickListener(this);
//		ImageView iv_image = (ImageView)findViewById(R.id.iv_image);
//		BadgeView badgeView = new BadgeView(this);
//		badgeView.setTargetView(iv_image);
//		badgeView.setBadgeCount(3);

    }

    @Override
    protected int BindLayout() {
        return R.layout.activity_grow_step;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    @Override
    public void onClick(View v) {
        Intent intent = null;

        switch (v.getId()) {
            case R.id.back:
                finish();
                break;
            case R.id.next:
                intent = new Intent(GrowStepActivity.this, DynamicPublishActivity.class);
                startActivity(intent);
//				showToast("暂未开通，敬请期待！");
                break;
            case R.id.ll_class_dynamic://班级动态
                intent = new Intent(GrowStepActivity.this, ClassDynamicActiviy.class);
                startActivity(intent);
//				showToast("暂未开通，敬请期待！");
                break;
            case R.id.ll_mine_dynamic://我的动态
                intent = new Intent(GrowStepActivity.this, MyClassDynamicActivity.class);
                intent.putExtra("userId", GlobalData.getUserId(GrowStepActivity.this));
                intent.putExtra("boolean","0");
                startActivity(intent);
                break;
            default:
                break;
        }
    }


}
